package j.framework.query.core;

import j.framework.core.DataType;

/**
 * 查询字段元数据
 * Created by junhai on 2015/1/3.
 */
public class QueryFieldMetadata implements java.io.Serializable {
    private String queryFieldId;

    private String queryId;

    private String tableAliasName;//表别名

    private String fieldName;

    private boolean usedFieldNameAsKey;

    private String displayName;

    private String displayNameTag;//用来显示多表头

    private int width;//列宽

    private DataType dataType;//数据类型，指定java中的类型

    private boolean isPrimaryKey;//是否主键

    private boolean sortSupported;//是否支持排序

    private boolean isAsDefaultSort;//是否作为默认排序字段
    private String defaultSortOrder;//默认排序方向

    private DataAlign columnDataAlign;//数据对齐方式
    private DataAlign columnHeaderAlign;//列表头对齐方式

    private boolean isSuppressible;//这列是否隐藏

    private boolean asTreeField;//是否为树字段

    private boolean asTreeParentField;//是否为树父字段
    private FormatType formatType;

    private String formatOptions;

    private float displayOrder;//显示顺序

    public String getQueryFieldId() {
        return queryFieldId;
    }
    public void setQueryFieldId(String queryFieldId) {
        this.queryFieldId = queryFieldId;
    }

    public String getQueryId() {
        return queryId;
    }
    public void setQueryId(String queryId) {
        this.queryId = queryId;
    }

    public String getTableAliasName() {
        return tableAliasName;
    }
    public void setTableAliasName(String tableAliasName) {
        this.tableAliasName = tableAliasName;
    }

    public String getFieldName() {
        return fieldName;
    }
    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public boolean isUsedFieldNameAsKey() {
        return usedFieldNameAsKey;
    }
    public void setUsedFieldNameAsKey(boolean usedFieldNameAsKey) {
        this.usedFieldNameAsKey = usedFieldNameAsKey;
    }

    public String getDisplayName() {
        return displayName;
    }
    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    public String getDisplayNameTag() {
        return displayNameTag;
    }
    public void setDisplayNameTag(String displayNameTag) {
        this.displayNameTag = displayNameTag;
    }

    public int getWidth() {
        return width;
    }
    public void setWidth(int width) {
        this.width = width;
    }

    public DataType getDataType() {
        return dataType;
    }
    public void setDataType(DataType dataType) {
        this.dataType = dataType;
    }

    public boolean isPrimaryKey() {
        return isPrimaryKey;
    }
    public void setPrimaryKey(boolean isPrimaryKey) {
        this.isPrimaryKey = isPrimaryKey;
    }

    public boolean isSortSupported() {
        return sortSupported;
    }
    public void setSortSupported(boolean sortSupported) {
        this.sortSupported = sortSupported;
    }

    public boolean isAsDefaultSort() {
        return isAsDefaultSort;
    }
    public void setAsDefaultSort(boolean isAsDefaultSort) {
        this.isAsDefaultSort = isAsDefaultSort;
    }

    public String getDefaultSortOrder() {
        return defaultSortOrder;
    }
    public void setDefaultSortOrder(String defaultSortOrder) {
        this.defaultSortOrder = defaultSortOrder;
    }

    public DataAlign getColumnDataAlign() {
        return columnDataAlign;
    }
    public void setColumnDataAlign(DataAlign columnDataAlign) {
        this.columnDataAlign = columnDataAlign;
    }

    public DataAlign getColumnHeaderAlign() {
        return columnHeaderAlign;
    }
    public void setColumnHeaderAlign(DataAlign columnHeaderAlign) {
        this.columnHeaderAlign = columnHeaderAlign;
    }

    public float getDisplayOrder() {
        return displayOrder;
    }
    public void setDisplayOrder(float displayOrder) {
        this.displayOrder = displayOrder;
    }

    public boolean isSuppressible() {
        return isSuppressible;
    }
    public void setSuppressible(boolean isSuppressible) {
        this.isSuppressible = isSuppressible;
    }

    public boolean isAsTreeField() {
        return asTreeField;
    }
    public void setAsTreeField(boolean asTreeField) {
        this.asTreeField = asTreeField;
    }

    public boolean isAsTreeParentField() {
        return asTreeParentField;
    }
    public void setAsTreeParentField(boolean asTreeParentField) {
        this.asTreeParentField = asTreeParentField;
    }

    public FormatType getFormatType() {
        return formatType;
    }
    public void setFormatType(FormatType formatType) {
        this.formatType = formatType;
    }

    public String getFormatOptions() {
        return formatOptions;
    }
    public void setFormatOptions(String formatOptions) {
        this.formatOptions = formatOptions;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        QueryFieldMetadata that = (QueryFieldMetadata) o;

        if (queryFieldId != null ? !queryFieldId.equals(that.queryFieldId) : that.queryFieldId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return queryFieldId != null ? queryFieldId.hashCode() : 0;
    }
}
